<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>特采管理 - IFS备货预测系统</title>
{include file="header.php"}
</head>
<body class="skin-blue">
<style>
	.msg_box table tr{
		height:30px;
		padding:5px 10px;
	}
	.show_message:hover .msg_box{
		display:block !important
	}
	.msg_box:after{
		content: '';
		position: absolute;
		right: -8px;
		top: 15px;
		width: 0;
		height: 0;
		border-style: solid;
		border-color: transparent transparent #3595cc #3595cc;
		border-width: 4px;
	}
	.msg_box ul:nth-child(1){
		overflow:hidden;
		height:25px;
		line-height:25px;
		margin:0 0 10px;
	}
	.msg_box ul li{
		overflow:hidden;
		display:block;
		width:250px;
	}
	.lk ul li{
		float:left;
	}
</style>
<div class="wrapper">
	{include file="bread_crumbs.php"}
	<!--引入面包屑-->
	<section class="base-setting-wrap">
		<div class="row">
			<div class="col-md-12">
				<div class="box">
					<div class="nav-tabs-custom">
						<ul class="nav nav-tabs">
					      <li class="active"><a href="/purchase/">特采申请列表</a></li>
					      <li><a href="/purchase/index/specialdemand/">特采需求管理</a></li>
					    </ul>
				    </div>
	                <div class="box-header with-border clearfix">
	                	<div class="table-toolbar pull-right mb10 clearfix">
						  <div class="columns-right btn-group pull-right">
						    <button class="btn btn-default btn-sm" type="button" title="刷新" onClick="window.location.reload();"><i class="glyphicon glyphicon-refresh icon-refresh"></i></button>
						    <div class="keep-open btn-group" title="列">
						      <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="glyphicon glyphicon-th icon-th"></i> <span class="caret"></span></button>
						        <ul class="dropdown-menu" id="js_productOption">
								</ul>
						    </div>
						  </div>
						</div>
	                	<div class="box-form pull-right form-group-sm mr20">
	                		<div class="pull-left" style="padding-left:500px;">
	                			<a class="btn btn-primary btn-sm" href="/purchase/index/add/">添加特采申请</a>
	                			<a class="btn btn-primary btn-sm" href="/purchase/index/upload-excel/">导入特采申请</a>
	                			<a class="btn btn-primary btn-sm" href="/document/excel_model.xls">特采表格下载</a>
	                		</div>
	                		<p class="pull-right"><a href="javascript:;" class="btn btn-success btn-sm" id="js_toggleSearchBox"><i class="fa fa-search"></i><span class="pl5">搜索选项</span></a></p>
	                	</div>
	                	<div class="clearfix"></div>
						<div class="search-box" id="js_searchBox">
							<form method="get" action="/purchase/index" class="form-inline" id="search">
								<div class="form-group-sm">
									<p>
										<label class="control-label">添加时间：</label>
										<input type="text" name="create_time[]" value="{$datefrom}" class="form-control js_datePicker date_start_time" id="create_time_from">到
										<input type="text" name="create_time[]" value="{$time}" class="form-control js_datePicker date_end_time" id="create_time_to">
										<label class="control-label">最迟回货时间：</label>
										<input type="text" name="latest_time[]" id="latest_time_form" class="form-control js_datePicker date_start">到
										<input type="text" name="latest_time[]" id="latest_time_to" class="form-control js_datePicker date_end">
										<label class='control-label'>所属事业部：</label>
										<select class="form-control" name="dept_id" id="dept_id">
											<option value="-">选择事业部</option>
											{foreach from=$depts item="vor"}
											<option value="{$vor.id}">{$vor.department_name}</option>
											{/foreach}
										</select>
										<select class="form-control" name="warehouse_id" id="warehouse_id" style="width: 220px;">
										<option value="-">选择仓库</option>
										</select>
										<label class="control-label">备货类型：</label>
										<select class="form-control ml10" name="stocking_type" id="stocking_type">
											<option value="-">所有</option>
											<option value="1">正常备货</option>
											<option value="2">活动备货（第三方平台）</option>
											<option value="3">活动备货（自营平台）</option>
											<option value="4">活动备货（其他）</option>
										</select>
									</p>
									<p class="no-margin">
										<label class="control-label">审核状态：</label>
										<select class="form-control" name="examine_status" id="examine_status">
											<option value="-">所有</option>
											<option value="7">已通过</option>
											<option value="8">已作废</option>
											<option value="4">一级驳回</option>
											<option value="5">二级驳回</option>
											<option value="6">三级驳回</option>
											<option value="1">待一级审核</option>
											<option value="2">待二级审核</option>
											<option value="3">待三级审核</option>
										</select>
										<label class="control-label">采购状态：</label>
										<select class="form-control" name="purchase_status" id="purchase_status">
											<option value="-">所有</option>
											<option value="1">已采购</option>
											<option value="2">待采购</option>
											<option value="3">部分采购</option>
											<option value="4">已失效</option>
										</select>
										<label class="control-label ml10">搜索关键字类别：</label>
										<select class="form-control" name="search_type" id="search_type">
			                				<option value="-">请选择</option>
			                				<option value="1" selected>产品编码</option>
			                				<option value="2">产品名称</option>
			                				<option value="3">申请人</option>
			                				<option value="4">备注</option>
		                				</select>
										<input type="text" class="form-control" name="search" id="search_box">
										<button type="submit" class="btn btn-primary btn-sm">立即搜索</button>
										<!-- <button  class="btn btn-primary btn-sm">导出</button> -->
										<a href="/purchase/">清空搜索条件</a>
									</p>
								</div>
							</form>
						</div>
	                </div>
	                <!-- /.box-header -->
	                <div class="box-body">
	                  <table class="table table-bordered table-striped table-hover" id="js_productTable">
	                  	<thead>
							<tr>
								<th width="65">
								<input type="checkbox" name="checkall" id="checkbox"></th>
								<th data-field="operate" data-checked="{if in_array('operate',$productTableFiled)}true{else}false{/if}">操作</th>
								<th data-field="pcode" data-checked="{if in_array('pcode',$productTableFiled)}true{else}false{/if}">产品编码</th>
								<th data-field="pthumb" data-checked="{if in_array('pthumb',$productTableFiled)}true{else}false{/if}">产品图片</th>
								<th data-field="title" data-checked="{if in_array('title',$productTableFiled)}true{else}false{/if}" width="280">产品名称</th>
								<th data-field="product_from" data-checked="{if in_array('product_from',$productTableFiled)}true{else}false{/if}">申请数量</th>
								<th data-field="product_image" data-checked="{if in_array('product_image',$productTableFiled)}true{else}false{/if}">回货数量</th>
								<th data-field="product_category" data-checked="{if in_array('product_category',$productTableFiled)}true{else}false{/if}">待采数量</th>
								<th data-field="develop_category" data-checked="{if in_array('develop_category',$productTableFiled)}true{else}false{/if}">备货类型</th>
								<th data-field="develop_website" data-checked="{if in_array('develop_website',$productTableFiled)}true{else}false{/if}">可用库存</th>
								<th data-field="apply_mark" data-checked="{if in_array('apply_mark',$productTableFiled)}true{else}false{/if}">在途库存</th>
								<th data-field="apply_time" data-checked="{if in_array('apply_time',$productTableFiled)}true{else}false{/if}">采购员</th>
								<th data-field="apply_user" data-checked="{if in_array('apply_user',$productTableFiled)}true{else}false{/if}">存放仓库</th>
								<th data-field="platform" data-checked="{if in_array('platform',$productTableFiled)}true{else}false{/if}">平台仓</th>
								<th data-field="develop_time" data-checked="{if in_array('develop_time',$productTableFiled)}true{else}false{/if}">最迟回货时间</th>
								<th data-field="develop_user" data-checked="{if in_array('develop_user',$productTableFiled)}true{else}false{/if}">备注</th>
								<th data-field="develop_mark" data-checked="{if in_array('develop_mark',$productTableFiled)}true{else}false{/if}">申请人</th>
								<th data-field="develop_status" data-checked="{if in_array('develop_status',$productTableFiled)}true{else}false{/if}">销售人员</th>
								<th data-field="promote_time" data-checked="{if in_array('promote_time',$productTableFiled)}true{else}false{/if}">添加时间</th>
								<th data-field="promote_user" data-checked="{if in_array('promote_user',$productTableFiled)}true{else}false{/if}">修改时间</th>
								<th data-field="promote_time_limit" data-checked="{if in_array('promote_time_limit',$productTableFiled)}true{else}false{/if}">采购状态</th>
								<th data-field="promote_mark" data-checked="{if in_array('promote_mark',$productTableFiled)}true{else}false{/if}">审核状态</th>
								<th data-field="promote_status" data-checked="{if in_array('promote_status',$productTableFiled)}true{else}false{/if}">审核人</th>
								<th data-field="link_id" data-checked="{if in_array('link_id',$productTableFiled)}true{else}false{/if}">审核时间</th>
								<th data-field="sale" data-checked="{if in_array('sale',$productTableFiled)}true{else}false{/if}">预估销售时间段</th>
								<th data-field="click" data-checked="{if in_array('click',$productTableFiled)}true{else}false{/if}">预估总销量</th>
							</tr>
	                    </thead>
						<form action="/purchase/index/examinepurchases" method="get" id="inputs">
	                    {foreach from=$list item='values'}
	                    	<tr>
								<td><input type="checkbox" class="selects" name="checkitem[{$values.id}]" value="{if $values.platform_code!=''}{$values.platform_code}{else}{$values.warehouse_code}{/if}" data-warehouse-code="{if $values.platform_code!=''}{$values.platform_code}{else}{$values.warehouse_code}{/if}" data-goods-sn="{$values.goods_sn}" data-status="{$values.examine_status}" {if $values['examine_status'] == 8}disabled="true"{/if}/></td>
		                    	<td>
		                    		{if $values['examine_status'] == 1}
		                    		<a href="/purchase/index/edit?id={$values.id}" class="btn btn-primary btn-sm" data-toggle="tooltip" title="修改"><i class="fa fa-pencil"></i></a>
		                    		<a href="javascript:;" onclick="return del({$values.id}, {$values.transfer_status});" class="btn btn-danger btn-sm js_delete" data-toggle="tooltip" title="作废"><i class="fa fa-remove"></i></a>
		                    		{else}
		                    		{if $values['examine_status'] != 8 && $values['examine_status'] != 9}
		                    		<a href="javascript:;" onclick="return del({$values.id}, {$values.transfer_status});" class="btn btn-danger btn-sm js_delete" data-toggle="tooltip" title="作废"><i class="fa fa-remove"></i></a>
		                    		{else}
		                    		-
		                    		{/if}
		                    		{/if}
		                    	</td>
								<td>{$values.goods_sn}</td>
								<td><a href="{$pdmDomain}{$values.thumb_url}" target="_blank"><img src="{$pdmDomain}{$values.thumb_url}" class="img-thumbnail" width="50" height="50" data-toggle="tooltip" title="点击查看大图"></a></td>
								<td>{$values.product_name}</td>
								<td>{$values.apply_num}</td>
								<td class="show_message" style="position:relative;">
									{$values.return_num}
									<div class="msg_box" style="background:#3595cc !important;display:none;left:-300px;top:0;height:auto;width:300px;position:absolute;background:#eee;border:1px solid #eee;text-align:left;padding:10px;color: #fff;border-radius: 4px;">
										{if isset($values['return_log'])}
											<h4>回货记录：</h4>
											{foreach from=$values['return_log'] item='log'}
												<ul style="border-top:1px solid #eee;padding:10px 0 0;margin:0 0 10px !important">
													<li>回货日期：{$log['return_date']}</li>
													<li>回货数量：{$log['return_amount']}</li>
												</ul>
											{/foreach}
										{else}
											暂无回货记录
										{/if}
									</div>
								</td>
								<td>{if $values.examine_status==7}{$values.apply_num-$values.return_num}{else}-{/if}</td>
								<!-- --><td>{if isset($stocking_type[$values['stocking_type']])}{$stocking_type[$values['stocking_type']]}{else}-{/if}</td>
								<td>{if (isset($values['base_stock']))}{$values.base_stock}{else}0{/if}</td>
								<td>{if (isset($values['stock_on_way']))}{$values.stock_on_way}{else}0{/if}</td>
								<td>{$values.purchaser}</td>
								<td>
									{if isset($warehouse[$values['warehouse_code']]['warehouse_name'])}
									{$warehouse[$values['warehouse_code']]['warehouse_name']}
									{else}
									-
									{/if}
								</td>
								<td>
									{if isset($warehouse[$values['platform_code']]['warehouse_name'])}
									{$warehouse[$values['platform_code']]['warehouse_name']}
									{else}
									-
									{/if}
								</td>
								<td>{$values.latest_time}</td>
								<td class="remark_log" data-text="{$values.remark|wordwrap:80:"\n":true}"><a href="javascript:;">查看备注</a></td>
								<td>{$values.apply_user}</td>
								<td>{$values.sale_user}</td>
								<td>{$values.create_time}</td>
								<td>{$values.update_time}</td>
								<td>{if ($values['purchase_status'] != 0)}{$purchase_status[$values.purchase_status]}{else}-{/if}</td>
								<td class="show_message" style="position:relative">
									{$examine_status[$values.examine_status]}
									<div class="msg_box" style="background:#3595cc !important;display:none;left:-300px;top:0;height:auto;width:300px;position:absolute;background:#eee;border:1px solid #eee;text-align:left;padding:10px;color: #fff;border-radius: 4px;">
										{if isset($examine_list[$values['id']])}
											<h4>操作记录：</h4>
											{foreach from=$examine_list[$values['id']] item='vor'}
												<ul style="border-top:1px solid #eee;padding:10px 0 0;margin:0 0 10px !important">
													<li>操作：{$examine_status_2[$vor['examine_type']]}</li>
													<li>{$examine_type[$vor['examine_type']]}人：{$vor.examine_username}</li>
													<li>{$examine_type[$vor['examine_type']]}时间：{$vor.add_time}</li>
													{if !empty($vor['examine_reason'])}
													<li>
														{$examine_type[$vor['examine_type']]}原因：
														{$vor.examine_reason}
													</li>
													{/if}
												</ul>
											{/foreach}
										{else}
											暂无操作记录
										{/if}
									</div>
								</td>
								<td class="show_message" style="position:relative">
									{$values.examine_user}
									<div class="msg_box" style="z-index:3;background:#3595cc !important;display:none;left:-300px;top:0;height:auto;width:300px;position:absolute;border:1px solid #eee;text-align:left;padding:10px;color: #fff;border-radius: 4px;">
										{if isset($examine_list[$values['id']])}
											<h4>操作记录：</h4>
											{foreach from=$examine_list[$values['id']] item='vor'}
												<ul style="border-top:1px solid #eee;padding:10px 0 0;margin:0 0 10px !important">
													<li>操作：{$examine_status_2[$vor['examine_type']]}</li>
													<li>{$examine_type[$vor['examine_type']]}人：{$vor.examine_username}</li>
													<li>{$examine_type[$vor['examine_type']]}时间：{$vor.add_time}</li>
													{if !empty($vor['examine_reason'])}
													<li>
														{$examine_type[$vor['examine_type']]}原因：
														{$vor.examine_reason}
													</li>
													{/if}
												</ul>
											{/foreach}
										{else}
											暂无操作记录
										{/if}
									</div>
								</td>
								<td>{if isset($examine_list[$values['id']])}{$examine_list[$values['id']][0]['add_time']}{else}-{/if}</td>
								<!-- <td>{if !isset($values.examine_reason) || empty($values.examine_reason)}-{else}{$values.examine_reason}{/if}</td> -->
								<td>{$values.expect_from}-{$values.expect_to}</td>
								<td>{$values.expect_sale_num}</td>
							</tr>
						{/foreach}
	              	</table>
					<div class="form-group-sm mt20">
						<select class="form-control slct" id="examine" name="examine_type">
							<option value="-">请选择</option>
							<option value="2">一级审核</option>
							<option value="3">二级审核</option>
							<option value="7">三级审核</option>
							<option value="4">一级驳回</option>
							<option value="5">二级驳回</option>
							<option value="6">三级驳回</option>
							<option value="8">作废</option>
						</select>
						<button type="submit" id="reject" class="btn btn-primary btn-sm">确定</button>
					</div>
					</form>
	                </div>
	                <!-- .box-body -->
	                <div class="box-footer text-center clearfix">{$page}</div>
	              </div>
			</div>
		</div>
	</section>
</div>
<!-- 批量驳回 -->
<div style='display:none;width:400px;padding-top:10px;padding-left:10px;' id="js_RemarkPop">
    <div class="form-group">
        <textarea id="reject_reason" style="width:100%;height:100px;"></textarea>
    </div>
    <div class="text-center pt10" id="handle"></div>
</div>
<script src="{$js.url}lib/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="{$js.url}lib/bootstrap.min.js" type="text/javascript"></script>
<script src="{$js.url}plugins/datapicker/bootstrap-datepicker-cn.js" type="text/javascript"></script>
<script src="{$js.url}plugins/multiselect/js/bootstrap-multiselect.js" type="text/javascript"></script>
<script src="{$js.url}plugins/layer.js" type="text/javascript"></script>
<!-- 日期 -->
<script src="{$js.url}plugins/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<!--common js-->
<script src="{$js.url}common.js"></script>
<link rel="stylesheet" type="text/css" href="{$js.url}plugins/select2/css/select2.min.css">
<script type="text/javascript" src="{$js.url}plugins/select2/js/select2.min.js"></script>
<script>
var data = {$params};
var del_id = 0;
var is_wait = 0;
{literal}
var productTableFiled = new Array();
//获取勾选显示的字段

$('[data-checked="true"]').each(function(i){
	field = $(this).attr('data-field');
	productTableFiled.push(field);
});
// 存储 cookie
function setFiledCookie(){
	$.cookie('productTableFiled_special',productTableFiled.join(","),{expires: 7, path:'/'});
}
setFiledCookie();

	$("td.remark_log").hover(
		function () {
			var log= $(this).data('text');
			if(log!=""){
				layer.tips(log,this,{
					tips: [4, '#3595CC'],
					skin: 'layui-layer-molv',
					time:0
				});
			}
		},
		function () {
			layer.closeAll('tips')
		}
	);
	$('#checkbox').click(function (){
		if($(this).prop('checked') == true){
			$('input.selects').prop('checked', 'checked');
		}else{
			$('input.selects:checkbox').prop('checked', false);
		}
	});
	$.createTableOption({
		tableBox:"#js_productTable",
		optionBox:"#js_productOption",
		onOptionChange:function(index,obj,field){
			//保存cookie
			if(obj.prop("checked")){
				productTableFiled.push(field);
			}
			else{
				productTableFiled.remove(field);
			}
			setFiledCookie();
		}
	});

	// 驳回与作废操作
	function save_changed($type, $cancel_type){
		if($type == 1){
			return examine_one($cancel_type);
		}
		return examine_list();
	}

	/* 批量驳回 */
	function examine_list(){
		if(is_wait) {
			layer.msg('请稍后……！');
		}
		is_wait = 1;
		$.get($('#inputs').attr('action'), $('#inputs').serialize() + '&examine_reason=' + $('#reject_reason').val(), function (result){
			is_wait = 0;
			layer.alert(result.message);
			if(result.status){
				setTimeout(function (){
					history.go(0);
				}, 1000);
			}
		}, 'json');
		return false;
		layer.close();
	}

	/* 作废一单 */
	function examine_one(type){
		if(is_wait) {
			layer.msg('请稍后……！');
		}
		is_wait = 1;
		$.get('/purchase/index/del', {id : del_id, examine_reason : $('#reject_reason').val(), type : type}, function (result){
			is_wait = 0;
			if(result == 1){
				window.location.reload();
			}else{
				try{
					var json = eval('(' + result + ')');
					layer.msg(json.message);
				} catch(e) {
					layer.msg('未作更新，可能是单据已经在当前要操作的状态下！');
				}
			}
		}, 'text');
		return false;
	}

	/* 作废单条数据 */
	function del(id, type){
		type == 2 ? msg = '本单现在进行作废，将在第二天生效，' : msg = '';
		msg += '确定作废？';
		layer.confirm(msg, function (index){
			layer.open({
				type: 1,
				title:'请输入原因',
				skin: 'layui-layer-lan',
				area: ['420px', '280px'], // 宽高
				content: $("#js_RemarkPop")  // 也可以 $("#div")
			});
			del_id = id;
			$('#handle').html('<button type="submit" class="btn btn-primary fb pr20 pl20" onclick="return save_changed(1,' + type + ')">保存</button>');
			layer.close(index);
			return false;
		});
	}

	/* 审核操作 */
	$('#inputs').submit(function (){
		if($('#examine option:selected').val() == '-'){
			layer.msg('请先选择操作方式！');
			return false;
		}
		layer.confirm('确定操作？', function (index){
			switch(parseInt($('#examine option:selected').val())){
				case 4:
				case 5:
				case 6:
				case 8:
					layer.open({
				        type: 1,
				        title:'请输入原因',
				        skin: 'layui-layer-lan',
				        area: ['420px', '250px'], //宽高
				        content: $("#js_RemarkPop")  //也可以 $("#div")
				    });
				    $('#handle').html('<button type="submit" class="btn btn-primary fb pr20 pl20" onclick="return save_changed()">保存</button>');
					layer.close(index);
				return false;
			}
			save_changed();
		});
		return false;
	});

	// 查看备注
	$('.js_viewMark').click(function (){
		layer.alert($(this).attr('data-text'), {
			skin:'layui-layer-lan' //样式类名
  			,closeBtn:0
		});
	});
	// 日期选择
	$('.date_start_time').datetimepicker({
	    format: "yyyy-mm-dd hh:00",
        minView:1,
        autoclose: true,
        todayHighlight: false
	}).on('changeDate', function(ev){
        $(".date_end_time").val("").datetimepicker('setStartDate',$(this).val());
    });
    $('.date_end_time').datetimepicker({
	    format: "yyyy-mm-dd hh:00",
        minView:1,
        autoclose: true,
        todayHighlight: false
	});

	// 日期选择
	$('.date_start').datetimepicker({
	    format: "yyyy-mm-dd",
        minView:2,
        autoclose: true,
        todayHighlight: false
	}).on('changeDate', function(ev){
        $(".date_end").val("").datetimepicker('setStartDate',$(this).val());
    });
    $('.date_end').datetimepicker({
	    format: "yyyy-mm-dd",
        minView:2,
        autoclose: true,
        todayHighlight: false
	});
	// 取仓库OPTION
	function warehouse(did){
		var did = !isNaN(did) ? did : $(this).find('option:selected').val();
		var str = '<option value="-">选择仓库</option>';
		$.ajax({
			url : '/base/warehouse/getselectedwarehousebydeptid',
			data : {did : did},
			dataType : 'json',
			type : 'get',
			success : function (result){
				$.each(result, function(i, n){
					if(n.id == data.warehouse_id){
						str += '<option value="' + n.id + '" selected>' + n.warehouse_name + '</option>';
					}else{
						str += '<option value="' + n.id + '">' + n.warehouse_name + '</option>';
					}
				});
				$('select[name="warehouse_id"]').html(str);
				$("#warehouse_id").select2();
			}
		});
	}
	//i saw your friend angin and we have chated for a while.
	warehouse(data.dept_id);
	$('#dept_id').change(warehouse);
	$('#examine_status option').each(function (){
		if($(this).val() == data.examine_status){
			$(this).attr('selected', 'selected');
			return false;
		}
	});
	$('#purchase_status option').each(function (){
		if($(this).val() == data.purchase_status){
			$(this).attr('selected', 'selected');
			return false;
		}
	});
	$('#stocking_type option').each(function (){
		if($(this).val() == data.stocking_type){
			$(this).attr('selected', 'selected');
			return false;
		}
	});
	$('#warehouse_id option').each(function (){
		if($(this).val() == data.warehouse_id){
			$(this).attr('selected', 'selected');
			return false;
		}
	});
	$('#dept_id option').each(function (){
		if($(this).val() == data.dept_id){
			$(this).attr('selected', 'selected');
		}
	});
	$('#search_type option').each(function (){
		if($(this).val() == data['search_type']){
			$(this).attr('selected', 'selected');
			return false;
		}
	});
	if(data.search != ''){
		$('#search_box').val(data.search);
	}
	if(data['create_time']){
		$('#create_time_from').val(data['create_time'][0]);
	}
	if(data['create_time']){
		$('#create_time_to').val(data['create_time'][1]);
	}
	if(data['latest_time']){
		$('#latest_time_form').val(data['latest_time'][0]);
	}
	if(data['latest_time']){
		$('#latest_time_to').val(data['latest_time'][1]);
	}
{/literal}
</script>
</body>
</html>
